package com.ymatou.iapi.userservice.testcase;

import java.util.Map;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.iapi.login.parameter.AliUserRequestDtoBean;
import com.ymatou.iapi.login.parameter.SinaWeiBoUserRequestDtoBean;
import com.ymatou.iapi.login.parameter.WeiXinUserRequestDtoBean;
import com.ymatou.iapi.login.service.WeiXinUserRequestDtoCall;
import com.ymatou.iapi.userservice.parameter.CheckMobileIsBindThirdPartyUserDtoBean;
import com.ymatou.iapi.userservice.parameter.enums.AppSourceEnum;
import com.ymatou.iapi.userservice.parameter.req.CreateUserReq;
import com.ymatou.iapi.userservice.service.CheckMobileIsBindThirdPartyUserDtoCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;
import com.ymt.utils.tag.P3;
import com.ymttest.business.service.JUserCallService;
import com.ymttest.database.sqlwapper.YmtUsersWapper;
import com.ymttest.utils.TestDataManager;
import com.ymttest.utils.constant.ECode;
import com.ymttest.utils.constant.ThirdPartyType;

/**
*检查手机号是否绑定过非当前（微信，alipay,weixin）账号接口
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_CheckMobileIsBindThirdPartyUserDto{
	private static CheckMobileIsBindThirdPartyUserDtoBean checkmobileisbindthirdpartyuserdtoBean;
	private static CheckMobileIsBindThirdPartyUserDtoCall checkmobileisbindthirdpartyuserdtoCall;
	private YmtUsersWapper userWapper;
	
	@BeforeClass
	public static void setUp() {
		//手机号是否绑定过非当前第三方账号
		Logger.createResultFile("检查手机号是否绑定过（微信，alipay,weixin）账号接口");
	}

	@Before
	public void caseUp() {
		checkmobileisbindthirdpartyuserdtoBean=new CheckMobileIsBindThirdPartyUserDtoBean();
		checkmobileisbindthirdpartyuserdtoCall=new CheckMobileIsBindThirdPartyUserDtoCall();
		userWapper = new YmtUsersWapper();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(checkmobileisbindthirdpartyuserdtoCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckMobileIsBindThirdPartyUserDto_001() {
		Logger.start(true,"手机绑定过非当前的阿里账号，验证绑定过非当前第三方账号");
		try {
			Logger.comment("从数据库中查询一个绑定过手机的阿里用户");
			String phone=TestDataManager.getPhoneNum();
			String aliUserId = "IsBindAli_"+TestDataManager.getRandomNum(10);
			String aliUserId2 = "IsBindAli2_"+TestDataManager.getRandomNum(10);
			AliUserRequestDtoBean aliUserRequestDtoBean=JUserCallService.initAliUserRequestDtoBean();
			aliUserRequestDtoBean.setMobile(phone);
			aliUserRequestDtoBean.setSAliUserId(aliUserId);
			JUserCallService.aliUserRequestDto(aliUserRequestDtoBean);
			//Thread.sleep(2000);
			Logger.comment("调用接口验证是否绑定过第三方账号");
			checkmobileisbindthirdpartyuserdtoBean.setMobile(phone);
			checkmobileisbindthirdpartyuserdtoBean.setThirdPartyId(aliUserId2);
			checkmobileisbindthirdpartyuserdtoBean.setThirdPartyType(ThirdPartyType.ALI);
			checkmobileisbindthirdpartyuserdtoCall.setData(checkmobileisbindthirdpartyuserdtoBean);
			checkmobileisbindthirdpartyuserdtoCall.callService();			
			Logger.verifyEquals(ECode.SUCCESS, checkmobileisbindthirdpartyuserdtoCall.getString("ResponseCode"), "验证Code");
			Logger.verifyEquals("true", checkmobileisbindthirdpartyuserdtoCall.getString("Success"), "验证操作是否成功");
			Logger.verifyEquals(ECode.USER_YES, checkmobileisbindthirdpartyuserdtoCall.getString("Result"), "验证该手机号绑定过第三方账号");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckMobileIsBindThirdPartyUserDto_002() {
		Logger.start(true,"手机绑定当前的阿里账号，验证未绑定过非当前第三方账号");
		try {
			Logger.comment("从数据库中查询一个绑定过手机的阿里用户");
			AliUserRequestDtoBean aliUserRequestDtoBean=JUserCallService.initAliUserRequestDtoBean();
			aliUserRequestDtoBean.setMobile(TestDataManager.getPhoneNum());
			JUserCallService.aliUserRequestDto(aliUserRequestDtoBean);
			//Thread.sleep(2000);
			String aliUserId = "IsBindAli_"+TestDataManager.getRandomNum(10);
			Logger.comment("调用接口验证是否绑定过第三方账号");
			checkmobileisbindthirdpartyuserdtoBean.setMobile(aliUserRequestDtoBean.getMobile());
			checkmobileisbindthirdpartyuserdtoBean.setThirdPartyId(aliUserRequestDtoBean.getSAliUserId());
			checkmobileisbindthirdpartyuserdtoBean.setThirdPartyType(ThirdPartyType.ALI);
			checkmobileisbindthirdpartyuserdtoCall.setData(checkmobileisbindthirdpartyuserdtoBean);
			checkmobileisbindthirdpartyuserdtoCall.callService();			
			Logger.verifyEquals(ECode.SUCCESS, checkmobileisbindthirdpartyuserdtoCall.getString("ResponseCode"), "验证Code");
			Logger.verifyEquals("true", checkmobileisbindthirdpartyuserdtoCall.getString("Success"), "验证操作是否成功");
			Logger.verifyEquals(ECode.USER_NO, checkmobileisbindthirdpartyuserdtoCall.getString("Result"), "验证该手机号绑定过第三方账号");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckMobileIsBindThirdPartyUserDto_003() {
		Logger.start(true,"手机绑定过非当前的微信账号，验证绑定过非当前第三方账号");
		try {
			Logger.comment("从数据库中查询一个绑定过手机的微信用户");
			WeiXinUserRequestDtoBean bean = JUserCallService.initWeiXinUserRequestDtoBean();
			bean.setMobile(TestDataManager.getPhoneNum());
			JUserCallService.weiXinUserRequestDto(bean);
			//Thread.sleep(2000);
			Logger.comment("调用接口验证是否绑定过第三方账号");
			checkmobileisbindthirdpartyuserdtoBean.setMobile(bean.getMobile());
			checkmobileisbindthirdpartyuserdtoBean.setThirdPartyId("isBindNotCurrentUser_"+TestDataManager.getRandomNum(10));
			checkmobileisbindthirdpartyuserdtoBean.setThirdPartyType(ThirdPartyType.WEIXIN);
			checkmobileisbindthirdpartyuserdtoCall.setData(checkmobileisbindthirdpartyuserdtoBean);
			checkmobileisbindthirdpartyuserdtoCall.callService();			
			Logger.verifyEquals(ECode.SUCCESS, checkmobileisbindthirdpartyuserdtoCall.getString("ResponseCode"), "验证Code");
			Logger.verifyEquals("true", checkmobileisbindthirdpartyuserdtoCall.getString("Success"), "验证操作是否成功");
			Logger.verifyEquals(ECode.USER_YES, checkmobileisbindthirdpartyuserdtoCall.getString("Result"), "验证该手机号绑定过第三方账号");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckMobileIsBindThirdPartyUserDto_004() {
		Logger.start(true,"手机绑定当前的微信账号，验证未绑定过非当前第三方账号");
		try {
			Logger.comment("从数据库中查询一个绑定过手机的微信用户");
			WeiXinUserRequestDtoBean bean = JUserCallService.initWeiXinUserRequestDtoBean();
			bean.setMobile(TestDataManager.getPhoneNum());
			JUserCallService.weiXinUserRequestDto(bean);
			//Thread.sleep(2000);
			Logger.comment("调用接口验证是否绑定过第三方账号");
			checkmobileisbindthirdpartyuserdtoBean.setMobile(bean.getMobile());
			checkmobileisbindthirdpartyuserdtoBean.setThirdPartyId(bean.getUnionId());
			checkmobileisbindthirdpartyuserdtoBean.setThirdPartyType(ThirdPartyType.WEIXIN);
			checkmobileisbindthirdpartyuserdtoCall.setData(checkmobileisbindthirdpartyuserdtoBean);
			checkmobileisbindthirdpartyuserdtoCall.callService();			
			Logger.verifyEquals(ECode.SUCCESS, checkmobileisbindthirdpartyuserdtoCall.getString("ResponseCode"), "验证Code");
			Logger.verifyEquals("true", checkmobileisbindthirdpartyuserdtoCall.getString("Success"), "验证操作是否成功");
			Logger.verifyEquals(ECode.USER_NO, checkmobileisbindthirdpartyuserdtoCall.getString("Result"), "验证该手机号绑定过第三方账号");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckMobileIsBindThirdPartyUserDto_005() {
		Logger.start(true,"手机绑定过非当前微博账号，验证绑定过非当前第三方账号");
		try {
			Logger.comment("从数据库中查询一个绑定过手机的微博用户");
			SinaWeiBoUserRequestDtoBean bean=JUserCallService.initSinaWeiBoUserRequestDtoBean();
			bean.setMobile(TestDataManager.getPhoneNum());
			JUserCallService.sinaWeiBoUserRequestDto(bean);
			//Thread.sleep(2000);
			Logger.comment("调用接口验证是否绑定过第三方账号");
			checkmobileisbindthirdpartyuserdtoBean.setMobile(bean.getMobile());
			checkmobileisbindthirdpartyuserdtoBean.setThirdPartyId("isBindNotCurrentWeibo_"+TestDataManager.getRandomNum(10));
			checkmobileisbindthirdpartyuserdtoBean.setThirdPartyType(ThirdPartyType.WEIBO);
			checkmobileisbindthirdpartyuserdtoCall.setData(checkmobileisbindthirdpartyuserdtoBean);
			checkmobileisbindthirdpartyuserdtoCall.callService();			
			Logger.verifyEquals(ECode.SUCCESS, checkmobileisbindthirdpartyuserdtoCall.getString("ResponseCode"), "验证Code");
			Logger.verifyEquals("true", checkmobileisbindthirdpartyuserdtoCall.getString("Success"), "验证操作是否成功");
			Logger.verifyEquals(ECode.USER_YES, checkmobileisbindthirdpartyuserdtoCall.getString("Result"), "验证该手机号绑定过第三方账号");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckMobileIsBindThirdPartyUserDto_006() {
		Logger.start(true,"手机绑定过当前微博账号，验证未绑定过非当前第三方账号");
		try {
			Logger.comment("从数据库中查询一个绑定过手机的微博用户");
			SinaWeiBoUserRequestDtoBean bean=JUserCallService.initSinaWeiBoUserRequestDtoBean();
			bean.setMobile(TestDataManager.getPhoneNum());
			JUserCallService.sinaWeiBoUserRequestDto(bean);
			//Thread.sleep(2000);
			Logger.comment("调用接口验证是否绑定过第三方账号");
			checkmobileisbindthirdpartyuserdtoBean.setMobile(bean.getMobile());
			checkmobileisbindthirdpartyuserdtoBean.setThirdPartyId(bean.getSWeiboUserId());
			checkmobileisbindthirdpartyuserdtoBean.setThirdPartyType(ThirdPartyType.WEIBO);
			checkmobileisbindthirdpartyuserdtoCall.setData(checkmobileisbindthirdpartyuserdtoBean);
			checkmobileisbindthirdpartyuserdtoCall.callService();			
			Logger.verifyEquals(ECode.SUCCESS, checkmobileisbindthirdpartyuserdtoCall.getString("ResponseCode"), "验证Code");
			Logger.verifyEquals("true", checkmobileisbindthirdpartyuserdtoCall.getString("Success"), "验证操作是否成功");
			Logger.verifyEquals(ECode.USER_NO, checkmobileisbindthirdpartyuserdtoCall.getString("Result"), "验证该手机号绑定过第三方账号");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckMobileIsBindThirdPartyUserDto_007() {
		Logger.start(false,"手机绑定过微博但未绑定过微信账号，传入类型为微信，验证未绑定过第三方账号");
		try {
			SinaWeiBoUserRequestDtoBean bean=JUserCallService.initSinaWeiBoUserRequestDtoBean();
			bean.setMobile(TestDataManager.getPhoneNum());
			JUserCallService.sinaWeiBoUserRequestDto(bean);
			//Thread.sleep(2000);
			String unionId = "bindUnionId_"+TestDataManager.getRandomNum(10);
			checkmobileisbindthirdpartyuserdtoBean.setMobile(bean.getMobile());
			checkmobileisbindthirdpartyuserdtoBean.setThirdPartyId("new"+unionId);
			checkmobileisbindthirdpartyuserdtoBean.setThirdPartyType(ThirdPartyType.WEIXIN);
			checkmobileisbindthirdpartyuserdtoCall.setData(checkmobileisbindthirdpartyuserdtoBean);
			checkmobileisbindthirdpartyuserdtoCall.callService();			
			Logger.verifyEquals(ECode.SUCCESS, checkmobileisbindthirdpartyuserdtoCall.getString("ResponseCode"), "验证Code");
			Logger.verifyEquals("true", checkmobileisbindthirdpartyuserdtoCall.getString("Success"), "验证操作是否成功");
			Logger.verifyEquals(ECode.USER_NO, checkmobileisbindthirdpartyuserdtoCall.getString("Result"), "验证该手机号未绑定过第三方账号");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_CheckMobileIsBindThirdPartyUserDto_008() {
		Logger.start(false,"不输入手机号，检查失败");
		try {
			checkmobileisbindthirdpartyuserdtoBean.setThirdPartyId("2088002766569564");
			checkmobileisbindthirdpartyuserdtoBean.setThirdPartyType(ThirdPartyType.WEIBO);
			checkmobileisbindthirdpartyuserdtoCall.setData(checkmobileisbindthirdpartyuserdtoBean);
			checkmobileisbindthirdpartyuserdtoCall.callService();			
			checkmobileisbindthirdpartyuserdtoCall.setData(checkmobileisbindthirdpartyuserdtoBean);
			checkmobileisbindthirdpartyuserdtoCall.callService();	
			
			Logger.verifyEquals("100", checkmobileisbindthirdpartyuserdtoCall.getString("ResponseCode"), "验证Code");
			Logger.verifyEquals("false", checkmobileisbindthirdpartyuserdtoCall.getString("Success"), "验证操作是否成功");
//			Logger.verifyEquals("错误的请求参数", checkmobileisbindthirdpartyuserdtoCall.getString("LastErrorMessage"), "验证Msg信息");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_CheckMobileIsBindThirdPartyUserDto_009() {
		Logger.start(false,"不输入第三方用户Id，检查失败");
		try {
			checkmobileisbindthirdpartyuserdtoBean.setMobile("13917572540");
			checkmobileisbindthirdpartyuserdtoBean.setThirdPartyType(ThirdPartyType.ALI);
			checkmobileisbindthirdpartyuserdtoCall.setData(checkmobileisbindthirdpartyuserdtoBean);
			checkmobileisbindthirdpartyuserdtoCall.callService();			
			Logger.verifyEquals("100", checkmobileisbindthirdpartyuserdtoCall.getString("ResponseCode"), "验证Code");
			Logger.verifyEquals("false", checkmobileisbindthirdpartyuserdtoCall.getString("Success"), "验证操作是否成功");
//			Logger.verifyEquals("错误的请求参数", checkmobileisbindthirdpartyuserdtoCall.getString("LastErrorMessage"), "验证Msg信息");	
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckMobileIsBindThirdPartyUserDto_010() {
		Logger.start(true,"已绑定weixinGlobalApp用户查询,BusinessType=3,返回yes已绑定过");
		try {
			WeiXinUserRequestDtoBean bean = JUserCallService.initWeiXinUserRequestDtoBean();
			bean.setRegSource(AppSourceEnum.GlobalApp);
			String mobile=TestDataManager.getPhoneNum();
			if(JUserCallService.mobileExists(mobile)){
				mobile=TestDataManager.getPhoneNum();
			}
			bean.setMobile(mobile);
			
			WeiXinUserRequestDtoCall wx = JUserCallService.weiXinUserRequestDto(bean);
			
			Integer uid=wx.getUid();
			//Thread.sleep(2000);
			Logger.comment("调用接口验证是否绑定过第三方账号");
			checkmobileisbindthirdpartyuserdtoBean.setMobile(bean.getMobile());
			checkmobileisbindthirdpartyuserdtoBean.setThirdPartyId("isBindNotCurrentUser_"+TestDataManager.getRandomNum(10));
			checkmobileisbindthirdpartyuserdtoBean.setThirdPartyType(ThirdPartyType.WEIXIN);
			checkmobileisbindthirdpartyuserdtoBean.setBusinessType(3);
			checkmobileisbindthirdpartyuserdtoCall.setData(checkmobileisbindthirdpartyuserdtoBean);
			checkmobileisbindthirdpartyuserdtoCall.callService();			
			Logger.verifyEquals(ECode.SUCCESS, checkmobileisbindthirdpartyuserdtoCall.getString("ResponseCode"), "验证Code");
			Logger.verifyEquals("true", checkmobileisbindthirdpartyuserdtoCall.getString("Success"), "验证操作是否成功");
			Logger.verifyEquals(ECode.USER_YES, checkmobileisbindthirdpartyuserdtoCall.getString("Result"), "验证该手机号绑定过第三方账号");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckMobileIsBindThirdPartyUserDto_011() {
		Logger.start(true,"已绑定weixin用户查询,BusinessType=3,返回no没绑定过GlobalApp渠道");
		try {
			WeiXinUserRequestDtoBean bean = JUserCallService.initWeiXinUserRequestDtoBean();
			bean.setRegSource(AppSourceEnum.App);
			String mobile=TestDataManager.getPhoneNum();
			if(JUserCallService.mobileExists(mobile)){
				mobile=TestDataManager.getPhoneNum();
			}
			bean.setMobile(mobile);
			
			WeiXinUserRequestDtoCall wx = JUserCallService.weiXinUserRequestDto(bean);
			
			Integer uid=wx.getUid();
			//Thread.sleep(2000);
			Logger.comment("调用接口验证是否绑定过第三方账号");
			checkmobileisbindthirdpartyuserdtoBean.setMobile(bean.getMobile());
			checkmobileisbindthirdpartyuserdtoBean.setThirdPartyId("isBindNotCurrentUser_"+TestDataManager.getRandomNum(10));
			checkmobileisbindthirdpartyuserdtoBean.setThirdPartyType(ThirdPartyType.WEIXIN);
			checkmobileisbindthirdpartyuserdtoBean.setBusinessType(3);
			checkmobileisbindthirdpartyuserdtoCall.setData(checkmobileisbindthirdpartyuserdtoBean);
			checkmobileisbindthirdpartyuserdtoCall.callService();			
			Logger.verifyEquals(ECode.SUCCESS, checkmobileisbindthirdpartyuserdtoCall.getString("ResponseCode"), "验证Code");
			Logger.verifyEquals("true", checkmobileisbindthirdpartyuserdtoCall.getString("Success"), "验证操作是否成功");
			Logger.verifyEquals(ECode.USER_NO, checkmobileisbindthirdpartyuserdtoCall.getString("Result"), "验证该手机号绑定过第三方账号");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckMobileIsBindThirdPartyUserDto_012() {
		Logger.start(true,"已绑定weixinGlobalApp用户查询,BusinessType=1,返回no未绑定过");
		try {
			WeiXinUserRequestDtoBean bean = JUserCallService.initWeiXinUserRequestDtoBean();
			bean.setRegSource(AppSourceEnum.GlobalApp);
			String mobile=TestDataManager.getPhoneNum();
			if(JUserCallService.mobileExists(mobile)){
				mobile=TestDataManager.getPhoneNum();
			}
			bean.setMobile(mobile);
			
			WeiXinUserRequestDtoCall wx = JUserCallService.weiXinUserRequestDto(bean);
			
			Integer uid=wx.getUid();
			//Thread.sleep(2000);
			Logger.comment("调用接口验证是否绑定过第三方账号");
			checkmobileisbindthirdpartyuserdtoBean.setMobile(bean.getMobile());
			checkmobileisbindthirdpartyuserdtoBean.setThirdPartyId("isBindNotCurrentUser_"+TestDataManager.getRandomNum(10));
			checkmobileisbindthirdpartyuserdtoBean.setThirdPartyType(ThirdPartyType.WEIXIN);
			checkmobileisbindthirdpartyuserdtoBean.setBusinessType(1);
			checkmobileisbindthirdpartyuserdtoCall.setData(checkmobileisbindthirdpartyuserdtoBean);
			checkmobileisbindthirdpartyuserdtoCall.callService();			
			Logger.verifyEquals(ECode.SUCCESS, checkmobileisbindthirdpartyuserdtoCall.getString("ResponseCode"), "验证Code");
			Logger.verifyEquals("true", checkmobileisbindthirdpartyuserdtoCall.getString("Success"), "验证操作是否成功");
			Logger.verifyEquals(ECode.USER_NO, checkmobileisbindthirdpartyuserdtoCall.getString("Result"), "验证该手机号绑定过第三方账号");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckMobileIsBindThirdPartyUserDto_013() {
		Logger.start(true,"未绑定过任何第三方用户查询,返回no未绑定过");
		try {
			CreateUserReq cur=new CreateUserReq();
			cur=JUserCallService.initCreateUserBean(cur);
			cur.setMail(TestDataManager.getEmail());
			int uid = JUserCallService.createUserCall(cur);
			//Thread.sleep(2000);
			Logger.comment("调用接口验证是否绑定过第三方账号");
			checkmobileisbindthirdpartyuserdtoBean.setMobile(cur.getMobile());
			checkmobileisbindthirdpartyuserdtoBean.setThirdPartyId("isBindNotCurrentUser_"+TestDataManager.getRandomNum(10));
			checkmobileisbindthirdpartyuserdtoBean.setThirdPartyType(ThirdPartyType.WEIXIN);
//			checkmobileisbindthirdpartyuserdtoBean.setBusinessType(1);
			checkmobileisbindthirdpartyuserdtoCall.setData(checkmobileisbindthirdpartyuserdtoBean);
			checkmobileisbindthirdpartyuserdtoCall.callService();			
			Logger.verifyEquals(ECode.SUCCESS, checkmobileisbindthirdpartyuserdtoCall.getString("ResponseCode"), "验证Code");
			Logger.verifyEquals("true", checkmobileisbindthirdpartyuserdtoCall.getString("Success"), "验证操作是否成功");
			Logger.verifyEquals(ECode.USER_NO, checkmobileisbindthirdpartyuserdtoCall.getString("Result"), "验证该手机号绑定过第三方账号");
			checkmobileisbindthirdpartyuserdtoBean.setBusinessType(1);
			checkmobileisbindthirdpartyuserdtoCall.callService();			
			Logger.verifyEquals(ECode.SUCCESS, checkmobileisbindthirdpartyuserdtoCall.getString("ResponseCode"), "验证Code");
			Logger.verifyEquals("true", checkmobileisbindthirdpartyuserdtoCall.getString("Success"), "验证操作是否成功");
			Logger.verifyEquals(ECode.USER_NO, checkmobileisbindthirdpartyuserdtoCall.getString("Result"), "验证该手机号绑定过第三方账号");
			checkmobileisbindthirdpartyuserdtoBean.setBusinessType(3);
			checkmobileisbindthirdpartyuserdtoCall.callService();			
			Logger.verifyEquals(ECode.SUCCESS, checkmobileisbindthirdpartyuserdtoCall.getString("ResponseCode"), "验证Code");
			Logger.verifyEquals("true", checkmobileisbindthirdpartyuserdtoCall.getString("Success"), "验证操作是否成功");
			Logger.verifyEquals(ECode.USER_NO, checkmobileisbindthirdpartyuserdtoCall.getString("Result"), "验证该手机号绑定过第三方账号");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckMobileIsBindThirdPartyUserDto_014() {
		Logger.start(true,"已绑定weixinGlobalApp和app用户查询,BusinessType=1和3,都返回yes已绑定过");
		try {
			WeiXinUserRequestDtoBean bean = JUserCallService.initWeiXinUserRequestDtoBean();
			bean.setRegSource(AppSourceEnum.App);
			String mobile=TestDataManager.getPhoneNum();
			if(JUserCallService.mobileExists(mobile)){
				mobile=TestDataManager.getPhoneNum();
			}
			bean.setMobile(mobile);
			
			JUserCallService.weiXinUserRequestDto(bean);
			//绑定信息uid不同
			String wxId = "wx_" + TestDataManager.getRandomNum(10);
			bean.setUnionId(wxId);
			bean.setRegSource(AppSourceEnum.GlobalApp);
			JUserCallService.weiXinUserRequestDto(bean);
			//Thread.sleep(2000);
			Logger.comment("调用接口验证是否绑定过第三方账号");
			checkmobileisbindthirdpartyuserdtoBean.setMobile(bean.getMobile());
			checkmobileisbindthirdpartyuserdtoBean.setThirdPartyId("isBindNotCurrentUser_"+TestDataManager.getRandomNum(10));
			checkmobileisbindthirdpartyuserdtoBean.setThirdPartyType(ThirdPartyType.WEIXIN);
//			checkmobileisbindthirdpartyuserdtoBean.setBusinessType(3);
			checkmobileisbindthirdpartyuserdtoCall.setData(checkmobileisbindthirdpartyuserdtoBean);
			checkmobileisbindthirdpartyuserdtoCall.callService();			
			Logger.verifyEquals(ECode.SUCCESS, checkmobileisbindthirdpartyuserdtoCall.getString("ResponseCode"), "验证Code");
			Logger.verifyEquals("true", checkmobileisbindthirdpartyuserdtoCall.getString("Success"), "验证操作是否成功");
			Logger.verifyEquals(ECode.USER_YES, checkmobileisbindthirdpartyuserdtoCall.getString("Result"), "验证该手机号绑定过第三方账号");
			checkmobileisbindthirdpartyuserdtoBean.setBusinessType(3);
			checkmobileisbindthirdpartyuserdtoCall.callService();			
			Logger.verifyEquals(ECode.SUCCESS, checkmobileisbindthirdpartyuserdtoCall.getString("ResponseCode"), "验证Code");
			Logger.verifyEquals("true", checkmobileisbindthirdpartyuserdtoCall.getString("Success"), "验证操作是否成功");
			Logger.verifyEquals(ECode.USER_YES, checkmobileisbindthirdpartyuserdtoCall.getString("Result"), "验证该手机号绑定过第三方账号");
			checkmobileisbindthirdpartyuserdtoBean.setBusinessType(1);
			checkmobileisbindthirdpartyuserdtoCall.callService();			
			Logger.verifyEquals(ECode.SUCCESS, checkmobileisbindthirdpartyuserdtoCall.getString("ResponseCode"), "验证Code");
			Logger.verifyEquals("true", checkmobileisbindthirdpartyuserdtoCall.getString("Success"), "验证操作是否成功");
			Logger.verifyEquals(ECode.USER_YES, checkmobileisbindthirdpartyuserdtoCall.getString("Result"), "验证该手机号绑定过第三方账号");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckMobileIsBindThirdPartyUserDto_015() {
		Logger.start(true,"已绑定weixinGlobalApp和app用户查询,BusinessType=1和3,都返回yes已绑定过（和14顺序相反）");
		try {
			WeiXinUserRequestDtoBean bean = JUserCallService.initWeiXinUserRequestDtoBean();
			bean.setRegSource(AppSourceEnum.GlobalApp);
			String mobile=TestDataManager.getPhoneNum();
			if(JUserCallService.mobileExists(mobile)){
				mobile=TestDataManager.getPhoneNum();
			}
			bean.setMobile(mobile);
			
			JUserCallService.weiXinUserRequestDto(bean);
			//绑定信息uid不同
			String wxId = "wx_" + TestDataManager.getRandomNum(10);
			bean.setUnionId(wxId);
			bean.setRegSource(AppSourceEnum.App);
			JUserCallService.weiXinUserRequestDto(bean);
			//Thread.sleep(2000);
			Logger.comment("调用接口验证是否绑定过第三方账号");
			checkmobileisbindthirdpartyuserdtoBean.setMobile(bean.getMobile());
			checkmobileisbindthirdpartyuserdtoBean.setThirdPartyId("isBindNotCurrentUser_"+TestDataManager.getRandomNum(10));
			checkmobileisbindthirdpartyuserdtoBean.setThirdPartyType(ThirdPartyType.WEIXIN);
//			checkmobileisbindthirdpartyuserdtoBean.setBusinessType(3);
			checkmobileisbindthirdpartyuserdtoCall.setData(checkmobileisbindthirdpartyuserdtoBean);
			checkmobileisbindthirdpartyuserdtoCall.callService();			
			Logger.verifyEquals(ECode.SUCCESS, checkmobileisbindthirdpartyuserdtoCall.getString("ResponseCode"), "验证Code");
			Logger.verifyEquals("true", checkmobileisbindthirdpartyuserdtoCall.getString("Success"), "验证操作是否成功");
			Logger.verifyEquals(ECode.USER_YES, checkmobileisbindthirdpartyuserdtoCall.getString("Result"), "验证该手机号绑定过第三方账号");
			checkmobileisbindthirdpartyuserdtoBean.setBusinessType(3);
			checkmobileisbindthirdpartyuserdtoCall.callService();			
			Logger.verifyEquals(ECode.SUCCESS, checkmobileisbindthirdpartyuserdtoCall.getString("ResponseCode"), "验证Code");
			Logger.verifyEquals("true", checkmobileisbindthirdpartyuserdtoCall.getString("Success"), "验证操作是否成功");
			Logger.verifyEquals(ECode.USER_YES, checkmobileisbindthirdpartyuserdtoCall.getString("Result"), "验证该手机号绑定过第三方账号");
			checkmobileisbindthirdpartyuserdtoBean.setBusinessType(1);
			checkmobileisbindthirdpartyuserdtoCall.callService();			
			Logger.verifyEquals(ECode.SUCCESS, checkmobileisbindthirdpartyuserdtoCall.getString("ResponseCode"), "验证Code");
			Logger.verifyEquals("true", checkmobileisbindthirdpartyuserdtoCall.getString("Success"), "验证操作是否成功");
			Logger.verifyEquals(ECode.USER_YES, checkmobileisbindthirdpartyuserdtoCall.getString("Result"), "验证该手机号绑定过第三方账号");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}